Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 8 Forum

Notes/Domino 8 Forum

Previous Next

Given up on remote IFS, but local IFS fails too...

I have given up on trying to move the file to another box, and will settle for getting the attachments in the IFS of the Domino Box… but I keep getting a

“Error creating product object”

Error when it runs.

Here’ what I’m using as an agent:



Dim sDir As String
Dim s As NotesSession
Dim w As NotesUIWorkspace
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument

Sub Initialize

Set s = New NotesSession
Set w = New NotesUIWorkspace
Set db = s.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
Dim rtItem As NotesRichTextItem
Dim RTNames List As String
Dim DOCNames List As String
Dim itemCount As Integer
Dim sDefaultFolder As String
Dim x As Integer
Dim vtDir As Variant
Dim iCount As Integer
Dim j As Integer
Dim lngExportedCount As Long
Dim attachmentObject As Variant

sDir = "/CustImport/CustomerFiles"

' Msgbox sDir

While Not ( doc Is Nothing )

iCount = 0
itemCount = 0
lngExportedCount = 0
Erase RTNames
Erase DocNames

'Scan all items in document
Forall i In doc.Items

If i.Type = RICHTEXT Then
Set rtItem = doc.GetfirstItem(i.Name)
If Not Isempty(rtItem.EmbeddedObjects) Then
RTNames(itemCount) = Cstr(i.Name)
itemCount = itemCount + 1
End If
End If

End Forall

For j = 0 To itemCount - 1
Set rtItem = Nothing
Set rtItem = doc.GetfirstItem(RTNames(j))
Forall Obj In rtItem.EmbeddedObjects
If (Obj.Type = EMBED_ATTACHMENT) Then
Call ExportAttachment(Obj)
Call Obj.Remove
Call doc.Save(False, True)
'creates conflict doc if conflict exists
End If
End Forall
Next

'Scan all items in document
Forall i In doc.Items

If i.Type = ATTACHMENT Then
DOCNames(lngExportedCount) = i.Values(0)
lngExportedCount = lngExportedCount + 1

End If

End Forall

For j% = 0 To lngExportedCount -1
Set attachmentObject = Nothing
Set attachmentObject = doc.GetAttachment(DOCNames(j% ))
Call ExportAttachment(attachmentObject)
Call attachmentObject.Remove
Call doc.Save(False, True)
'creates conflict doc if conflict exists
Next

Set doc = dc.GetNextDocument(doc)
Wend

Msgbox "Export Complete.", 16, "Finished"

End Sub

Sub ExportAttachment(o As Variant)

Dim sAttachmentName As String
Dim sNum As String
Dim sTemp As String

sAttachmentName = sDir & "/" & o.Source
Print "The filename path is " & sAttachmentName

While Not (Dir$ (sAttachmentName, 0 ) = "" )
sNum = Right (Strleftback(sAttachmentName, "."), 2)
If Isnumeric(sNum) Then
sTemp = Strleftback(sAttachmentName, ".")
sTemp = Left(sTemp, Len(sTemp) - 2)
sAttachmentName = sTemp & Format$ ( Cint (sNum) + 1, "##00" ) & "." & Strrightback(sAttachmentName, ".")
Else
sAttachmentName = Strleftback(sAttachmentName, ".") & "01." & Strrightback(sAttachmentName, ".")
End If
Wend

Print "Exporting " & sAttachmentName
'Save the file
Call o.ExtractFile( sAttachmentName )

End Sub


Feedback response number WEBB7VZQEN created by ~Ted Dworeburakol on 09/18/2009

Notes email attachment to IFS Agent... (~Isaac Chukrofl... 15.Sep.09)
. . authenticate (~Cheryl Umaobu 16.Sep.09)
. . . . Different Box (~Isaac Chukrofl... 16.Sep.09)
. . . . . . qnotes on target box? (~Cheryl Umaobu 16.Sep.09)
. . . . . . . . yes... he is on the target box (~Isaac Chukrofl... 16.Sep.09)
. . . . . . some more options (~Fred Chuvelupl... 16.Sep.09)
. . . . . . . . Why I have to move them (~Isaac Chukrofl... 16.Sep.09)
. . . . . . . . . . QFileSvr.400 (~Cheryl Umaobu 17.Sep.09)
. . Given up on remote IFS, but local I... (~Isaac Chukrofl... 18.Sep.09)
. . . . where do you get the error? (~Fred Chuvelupl... 18.Sep.09)
. . . . . . Can't really tell... (~Isaac Chukrofl... 18.Sep.09)
. . . . . . . . you can use an agent log (~Fred Chuvelupl... 21.Sep.09)
. . . . . . . . . . Found the problem... (~Isaac Chukrofl... 22.Sep.09)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS